export const Rules = {
  name: [
    { required: true, message: '请输入资源名称', trigger: 'blur' },
    { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' }
  ],
  code: [
    { required: true, message: '请输入资源编号', trigger: 'blur' },
    { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' }
  ],
  from: [
    { required: true, message: '请输入数据来源', trigger: 'blur' },
    { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' }
  ],
  production_resource: [
    { required: true, message: '请输入生产资源', trigger: 'blur' },
    { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' }
  ],
  data_update_time: [
    { required: true, message: '请选择数据更新时间', trigger: 'change' }
  ],
  resource_owner_code: [
    { required: true, message: '请选择资源所属单位', trigger: 'change' }
  ],
  // 是否是根资源
  is_root: [
    { required: true, message: '请选择是否是根资源', trigger: 'change' }
  ],
}

export function CreateColumnData() {
  return {
    resourceCode: '',
    type: '',
    relationType: '',
    relationResourceCode: '',
  }
}
export const Columns = [
  {
    title: '序号', dataIndex: 'index', slotName: 'index', width: 80
  },
  {
    title: '资源名称', dataIndex: 'resourceCode', slotName: 'resourceCode'
  },
  {
    title: '类型', dataIndex: 'type', slotName: 'type'
  },
  {
    title: '关联类型', dataIndex: 'relationType', slotName: 'relationType'
  },
  {
    title: '关联资源名称', dataIndex: 'relationResourceCode', slotName: 'relationResourceCode'
  },
  {
    title: '操作', dataIndex: 'operator', slotName: 'operator'
  },
]

export const ColumnsView = [
  {
    title: '序号', dataIndex: 'index', slotName: 'index', width: 80
  },
  {
    title: '资源名称', dataIndex: 'name', slotName: 'name'
  },
  {
    title: '类型', dataIndex: 'type', slotName: 'type'
  },
  {
    title: '关联类型', dataIndex: 'relationType', slotName: 'relationType'
  },
  {
    title: '关联资源名称', dataIndex: 'relationResourceCode', slotName: 'relationResourceCode'
  },

]